package imper.engine.entity;

import java.util.HashSet;
import java.util.Set;

public class Offer
{
  protected Integer _countryId = null;
  protected Integer _resourceId = null;
  protected Integer _quantity = null;
  //
  protected Set<Integer> _countryReply = null;
  protected OfferState _state = null;

  public Offer(Integer pCountryId, Integer pResourceId, Integer pQuantity)
  {
    this._countryId = pCountryId;
    this._resourceId = pResourceId;
    this._quantity = pQuantity;
    this._countryReply = new HashSet<Integer>();
    this._state = OfferState.OFFER;
  }

  /**
   * @return the countryId
   */
  public Integer getCountryId()
  {
    return _countryId;
  }

  /**
   * @param countryId the countryId to set
   */
  public void setCountryId(Integer countryId)
  {
    this._countryId = countryId;
  }

  /**
   * @return the resourceId
   */
  public Integer getResourceId()
  {
    return _resourceId;
  }

  /**
   * @param resourceId the resourceId to set
   */
  public void setResourceId(Integer resourceId)
  {
    this._resourceId = resourceId;
  }

  /**
   * @return the quantity
   */
  public Integer getQuantity()
  {
    return _quantity;
  }

  /**
   * @param quantity the quantity to set
   */
  public void setQuantity(Integer quantity)
  {
    this._quantity = quantity;
  }

  public void AddCountryReply(Integer pCoutnryId)
  {
    this._countryReply.add(pCoutnryId);
  }

  public boolean hasCountryReply(Integer pCountryId)
  {
    return this._countryReply.contains(pCountryId);
  }

  public void updateState(OfferState pOfferState)
  {
    this._state = pOfferState;
  }
}
